\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}
\usetikzlibrary{calc}

\title{图12.1}
\author{LY}
\date{\today}

\begin{document}
\maketitle % 添加标题

\begin{figure}
\centering % 居中显示
\begin{tikzpicture}
\begin{scope}[shift={(0, 0)}]
    \draw[->] (0,0) -- (6,0) node[right] {X};    
	\draw(6,0) node[below] {$L_x$};    
	\draw[->] (0,0) -- (0,6) node[above] {Y};    
	\draw(0,6) node[left] {$L_y$};    
	% 绘制正方形并添加箭头    
	\draw[perpendicular] (0,0) -- (6,0);    
	\draw[perpendicular] (6,0) -- (6,6);    
	\draw[perpendicular] (6,6) -- (0,6);    
	\draw[perpendicular] (0,6) -- (0,0);
	\draw[<->] (0,3) -- (1,3);
	\draw[<->] (3,0) -- (3,1);
	\draw[<->] (5,3) -- (7,3);
	\draw[<->] (3,5) -- (3,6);
 \draw (0,3) node[right] {$periodicity$};                             
    \draw (3,0) node[above] {$periodicity$};                             
    \draw (6,3) node[right] {$periodicity$}; 
	\draw (3,6) node[below] {$periodicity$};
\end{scope}          

\begin{scope}[shift={(8, 0)}]
    % 绘制 x 轴
    \draw [-latex] (0, 0) -- (6, 0) node [above] {$x$};
        \draw(6,0) node[below] {$L_x$};
    % 绘制 y 轴
    \draw [-latex] (0, 0) -- (0, 6) node [right] {$y$};
        \draw(0,6) node[left] {$L_y$};
    \draw (0.0, 0.0) rectangle (6,6); % 绘制边界矩形
    \draw[dashed] (0, 3) -- (6,3);         
    \draw[dashed] (3, 0) -- (3,6);       
    \draw[green] (0,2) -- (6,2);                                              
    \draw[green] (0,4) -- (6,4);          
    \draw[green] (2,0) -- (2,6);         
    \draw[green] (4,0) -- (4,6);                                                                                                    
    \draw (2,0) node[below] {$x_c(i)$};                             
    \draw (3,0) node[above] {$x_m(i)$};                             
    \draw (4,0) node[below] {$x_c(i+1)$};                         
    \draw (0,2) node[left] {$y_c(j)$};  
    \draw (0,3) node[left] {$y_m(j)$};  
    \draw (0,4) node[left] {$y_c(j+1)$};
    \draw[fill] (3,2) circle[radius=2pt] node[right] {$v(i,j)$};
    \draw[fill] (3,3) circle[radius=2pt] node[right] {$p(i,j)$};
    \draw[fill] (2,3) circle[radius=2pt] node[right] {$u(i,j)$};
\end{scope}

\end{tikzpicture}
\end{figure}

\end{document}
